/**
 * @Author: LongTao
 * @program: day04_longtao_springmvc_1917JA_20210108
 * @description:
 * @create: 2021-01-19 19:01
 * @version:1.0
 **/
package com.springmvc.longtao.smbms.utils;


//import org.springframework.web.bind.WebDataBinder;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;

import java.text.SimpleDateFormat;
import java.util.Date;

public class BaseController {
    @InitBinder
    //WebDataBinder
    public void initBinder(WebDataBinder dataBinder){
        System.out.println("======init binder=====");
        dataBinder.registerCustomEditor(Date.class,new CustomDateEditor(new SimpleDateFormat("yyyy-MM-dd"),true));
    }
}